feat(google-sheets): add filter support to read operation#3333
feat(google-sheets): add filter support to read operation#3333waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
f7f3ce9 to
5ae7de4
Compare
|
@greptile |
|
@cursor review |
Greptile SummaryAdded client-side row filtering to Google Sheets Read operation (V2 only) with support for filtering by column name and value using four match types:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Google Sheets API Call] --> B{Response Received}
B --> C[Extract values array]
C --> D{Filter params provided?}
D -->|No| H[Return all values]
D -->|Yes filterColumn & filterValue| E{Values length > 1?}
E -->|No| H
E -->|Yes| F[Find column index in headers]
F --> G{Column found?}
G -->|No| H
G -->|Yes| I[Apply match type filter]
I --> J{Match Type?}
J -->|contains| K[cellValue.includes filterVal]
J -->|exact| L[cellValue === filterVal]
J -->|starts_with| M[cellValue.startsWith filterVal]
J -->|ends_with| N[cellValue.endsWith filterVal]
K --> O[Filter rows]
L --> O
M --> O
N --> O
O --> P[Return header + filtered rows]
H --> Q[Return response]
P --> Q
Last reviewed commit: 5ae7de4 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| ...(filterColumn ? { filterColumn: (filterColumn as string).trim() } : {}), | ||
| ...(filterValue !== undefined && filterValue !== '' | ||
| ? { filterValue: filterValue as string } | ||
| : {}), |
There was a problem hiding this comment.
Filter value not trimmed unlike all other params
Medium Severity
Every other user-supplied string parameter in transformForTool is .trim()-ed — spreadsheetId, sheetName, cellRange, title, sheetTitles, destinationSpreadsheetId, and even filterColumn on the line just above — but filterValue is passed through as-is. Accidental leading or trailing whitespace in the filter value input will cause the case-insensitive comparison in read.ts to silently return no matches (e.g., "exact" comparing " active " against "active").
* feat(google-sheets): add filter support to read operation * ran lint


Summary
Type of Change
Testing
Tested manually
Checklist